package com.hkbigdata.transfrom;

import org.apache.flink.streaming.api.datastream.ConnectedStreams;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author liuanbo
 * @creat 2023-04-19-19:08
 * @see 2194550857@qq.com
 */
public class Flink06_TransFrom_Connect {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);

        DataStreamSource<Integer> integerDataStreamSource = env
                .fromElements(10, 3, 5, 9, 20, 8);

        DataStreamSource<String> stringDataStreamSource = env.fromElements("ab", "c", "hello");
        DataStreamSource<String> stringDataStreamSource1 = env.fromElements("ab", "c", "hello");

        ConnectedStreams<Integer, String> connect = integerDataStreamSource.connect(stringDataStreamSource);



        connect.getFirstInput().print("first");
        connect.getSecondInput().print("second");

        env.execute();

    }
}
